From cd40ec22001c18fb7706a0c5a3588d93a8031d16 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 19 Aug 2018 01:15:28 +0000 Subject: [PATCH] gdk/wayland: Don't remap non-subsurface as subsurface Let's just use the fact that a window was mapped as a subsurface to remap it above another transient parent instead of relying on the more complicated 'should-map-as-subsurface' helper function. --- gdk/wayland/gdksurface-wayland.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index af5881007d..af12fa8290 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -3404,6 +3404,7 @@ gdk_wayland_surface_set_transient_for (GdkSurface *surface, GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface)); GdkSurface *previous_parent; + gboolean was_subsurface = FALSE; g_assert (parent == NULL || gdk_surface_get_display (surface) == gdk_surface_get_display (parent)); @@ -3417,7 +3418,10 @@ gdk_wayland_surface_set_transient_for (GdkSurface *surface, unset_transient_for_exported (surface); if (impl->display_server.wl_subsurface) - unmap_subsurface (surface); + { + was_subsurface = TRUE; + unmap_subsurface (surface); + } previous_parent = impl->transient_for; impl->transient_for = parent; @@ -3431,8 +3435,7 @@ gdk_wayland_surface_set_transient_for (GdkSurface *surface, g_list_remove (display_wayland->orphan_dialogs, surface); } gdk_wayland_surface_sync_parent (surface, NULL); - if (should_map_as_subsurface (surface) && - parent && gdk_surface_is_visible (surface)) + if (was_subsurface && parent) gdk_wayland_surface_create_subsurface (surface); } -- 2.30.2